<template>
	<view>
		<uni-titles :title="'设备'"></uni-titles>
		<uni-onlytitlelist :title="'地块信息'"  >
			<view class="foundationTtem fs-24" :class="'foundationTtem' + d.choose" v-for="(d, index) in list" :key="d.id">
				<view class="name">{{ d.name }}</view>
				<view class="text">{{ d.text }}</view>
				<view class="type">{{ d.type }}</view>
			</view>
		</uni-onlytitlelist>
		<uni-onlytitlelist :title="'绑定设备'"  >
			<view class="Rightbtn">
				<view class="btn"><u-button text="增加设备" type="success"></u-button></view>
			</view>
			<uni-inputs :title="'设备名称'" :placeholder="'请选择物联设备'" icon readonly :margin="[30, 0, 30, 0]"></uni-inputs>
			<uni-inputs :title="'设备SM码'" :placeholder="'请输入设备SM码'" icon readonly :margin="[30, 0, 30, 0]"></uni-inputs>
		</uni-onlytitlelist>
		<view>
			<view v-for="(d, index) in msgList" :key="d.name">
				<uni-onlytitlelist :title="'设备' + (index + 1)"  >
					<view class="Peizhibox fs-24">
						<view class="item">
							<view class="textbox mar-top30">
								<view class="title">设备名称</view>
								<view>{{ d.name }}</view>
							</view>
							<view class="textbox mar-top30">
								<view class="title">设备SM码</view>
								<view>{{ d.customer }}</view>
							</view>
						</view>
						<view class="rightcontent">
							<u--image :mode="'aspectFill'" :src="deleteIcon" width="30rpx" height="30rpx"></u--image>
							<view class="mar-left6">删除</view>
						</view>
					</view>
				</uni-onlytitlelist>
			</view>
		</view>
		<view class="Btnbox">
			<view><uni-lastbtn :text="'取消'" :bgColor="'#B2CEA4'" :width="'280rpx'" @btnfun="btnfun"></uni-lastbtn></view>
			<view class="mar-left48"><uni-lastbtn :text="'保存'" :width="'280rpx'" @btnfun="btnfun"></uni-lastbtn></view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			deleteIcon:
				'',
			list: [
				{
					name: '地块类型',
					text: '大棚',
					choose: 'dklx'
				},
				{
					name: '地块名称',
					text: '番茄园地'
				},
				{
					name: '作物名称',
					text: '番茄'
				},
				{
					name: '占地面积',
					text: '125.2亩'
				},
				{
					name: '种植地址',
					text: '天府广场种植园'
				}
			],
			
			msgList: [
				{
					name: '罗伟',
					customer: '罗二娃/罗三娃/罗四娃'
				},
				{
					name: '罗伟',
					customer: '罗二娃/罗久娃'
				}
			]
		};
	},
	methods: {
		groupChange(n) {
			console.log('groupChange', n);
		},
		radioChange(n) {
			console.log('radioChange', n);
		},
		btnfun(d) {
			console.log(d);
			if (d == '取消') {
				uni.navigateBack({
					delta: 1
				});
			} else if (d == '保存') {
				uni.showToast({
					title: '保存成功',
					icon: 'none'
				});
				setTimeout(() => {
					uni.navigateBack({
						delta: 1
					});
				}, 1000);
			}
		}
	}
};
</script>

<style lang="scss">
page {
	background: #f6f6f6;
}

</style>
